package com.mopa.qzonegallery;

import java.io.File;
import java.io.FileFilter;

public class ImageFilter implements FileFilter {
	//image type which should be filtered
	private static final String[] IMAGE = {".png", ".jpg", ".gif", ".bmp"};

	public boolean accept(File file) {
		if(file.isHidden() || file.isDirectory()){
			return false;
		}
		
		if(file.isFile()){
			for (String extension : IMAGE) {
				if (file.getName().toLowerCase().endsWith(extension)) {
					return true;
				}
			}
		}
		return false;
	}
}
